//Write by oshogbo//vx
//23.07.2011
//http://code.google.com/p/streamobs

import java.net.*;
import java.io.*;

public class Stats
{
  protected String refresh(String ip, String header)
  {
    try
    {
      Socket web = new Socket(ip, 80); // conect to server
      
      PrintWriter send = new PrintWriter(web.getOutputStream()); // creat Stream to write
      send.println(header);
      send.flush();
      InputStreamReader strRec = new InputStreamReader(web.getInputStream());// Creat strem to read
      BufferedReader rec = new BufferedReader(strRec); // ==||==
     
      String buf;
      String answer = new String();
      while( (buf = rec.readLine()) != null)
	answer += buf;

      rec.close();
      send.close();

      return answer;
    }catch(IOException ex)
    {
      ex.printStackTrace();
    }

    return null;
  }
}
